<?php 
	class MenuModel extends Model{
		public $table='menu';

		public $validate = array(
 		array('menuname','nonull','菜单名不能为空',2,3),
 		array('menuname','maxlen:10','菜单名最大长度不能超过20个',2,3),
 		
 		);

		public function add_data($where=NULL){
		return $this->where($where)->add();
		} 

		public function get_data($where=NULL){
		return $this->where($where)->all();
		}
		public function get_one_data($where=NULL){
		return $this->where($where)->find();
		}

		// 编辑
		public function update_data($where){
			$this->where($where)->save();
		}


		public function del_data($where){
			$this->where($where)->delete();
		}
	}




 ?>